home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
CGlobal.as
next >
Wrap
Text File
|
2011-08-19
|
12KB
|
384 lines
package Local
{
import Local.External.CKongregate;
import Local.External.CMochiBot;
import flash.events.EventDispatcher;
import flash.net.SharedObject;
public class CGlobal extends EventDispatcher
{
private static var _ShowMessages:Boolean = true;
public static var mLocalStats:Object;
private static var mFields:Object;
private static var _FastRender:Boolean = false;
private static var _SoundActive:Boolean = true;
public static var mLoadCPMStar:Boolean = §§pop();
public static const mDebug:Boolean = false;
public static var mShowIntro:Boolean = !mDebug;
public static var mStatsEnabled:Boolean = true;
public static var mStats:Object;
public static var mShowVideoTimer:Boolean = false;
public static var mProfiler:Boolean = false;
private static var mUnitNames:Object;
private static var mShared:SharedObject;
public static var mLoadingTime:int;
{
§§push(§§findproperty(mLoadCPMStar));
§§push(mDebug);
if(true)
{
§§push(!!§§pop() ? false : true);
}
§§push(§§findproperty(mLoadingTime));
if(true)
{
if(mDebug)
{
(1 * 1000).mLoadingTime = true ? int(§§pop()) : int(§§pop());
mShowVideoTimer = false;
_FastRender = false;
_SoundActive = true;
_ShowMessages = true;
return;
addr43:
}
else
{
§§push(7 * 1000);
}
§§goto(addr53);
}
§§goto(addr43);
}
public function CGlobal()
{
if(true)
{
super();
}
}
public static function ResetLocalStats() : void
{
mLocalStats = new Object();
}
public static function set mFastRender(param1:Boolean) : void
{
SetField("fastrender",_FastRender = param1);
}
public static function get mSoundActive() : Boolean
{
return _SoundActive;
}
public static function IncrementStat(param1:String) : uint
{
if(!mStatsEnabled)
{
return 0;
}
mStats[param1] = !!mStats[param1] ? mStats[param1] + 1 : 1;
mLocalStats[param1] = !!mLocalStats[param1] ? mLocalStats[param1] + 1 : 1;
return mStats[param1];
}
private static function Indent(param1:String, param2:Number) : String
{
var _loc3_:* = 0;
var _loc4_:String = null;
if(true)
{
§§push(10);
if(true)
{
§§push(int(§§pop() - Math.floor(param1.length / 4)));
}
_loc3_ = §§pop();
_loc4_ = "";
}
loop0:
while(true)
{
§§push(_loc3_);
while(§§pop() >= 0)
{
§§push(_loc3_);
if(true)
{
continue loop0;
}
}
§§push(param1 + _loc4_ + " = ");
if(true)
{
§§push(§§pop() + param2);
}
return §§pop();
}
}
public static function set mSoundActive(param1:Boolean) : void
{
SetField("sound",_SoundActive = param1);
}
public static function get mFastRender() : Boolean
{
return _FastRender;
}
public static function GetRealStatName(param1:String) : String
{
var _loc2_:String = null;
var _loc3_:Object = null;
if(param1.indexOf("_") == -1)
{
return param1;
}
_loc2_ = param1.substr(0,param1.indexOf("_"));
_loc3_ = mUnitNames[param1.substr(_loc2_.length + 1)];
if(true)
{
if(_loc3_)
{
var _loc4_:* = _loc2_;
if(true)
{
if("build" === _loc4_)
{
if(true)
{
§§push(0);
if(true)
{
}
}
else
{
addr137:
§§push(3);
}
addr152:
switch(§§pop())
{
case 0:
return _loc3_.mType == "enemy" ? _loc3_.mName + "s deployed" : (_loc3_.mType == "none" ? "Number of " + _loc3_.mName + "s" : _loc3_.mName + "s built");
case 1:
return _loc3_.mName + "s have fired";
case 2:
return _loc3_.mName + "s have killed";
case 3:
return _loc3_.mName + "s have been destroyed";
case 4:
return _loc3_.mName + "s have reached objective";
default:
§§goto(addr154);
}
}
else
{
if("fired" === _loc4_)
{
if(true)
{
§§push(1);
if(false)
{
addr142:
}
}
else
{
addr129:
§§push(2);
if(false)
{
§§goto(addr137);
}
}
}
else if("kill" === _loc4_)
{
§§goto(addr129);
}
else if("death" === _loc4_)
{
§§goto(addr137);
}
else if("robj" === _loc4_)
{
addr141:
§§goto(addr142);
§§push(4);
}
else
{
§§push(5);
}
§§goto(addr152);
}
§§goto(addr137);
}
§§goto(addr141);
addr44:
}
addr154:
return param1;
}
§§goto(addr44);
}
public static function FlushStats() : void
{
var _loc1_:* = null;
mShared.flush();
for(_loc1_ in mStats)
{
}
}
public static function GetField(param1:String) : *
{
return mFields[param1];
}
public static function GetLocalStat(param1:String) : uint
{
return mLocalStats[param1];
}
public static function SetField(param1:String, param2:*) : *
{
return mFields[param1] = param2;
}
public static function Open() : void
{
mShared = SharedObject.getLocal("army_110808");
mFields = mShared.data.mFields = !!mShared.data.mFields ? mShared.data.mFields : new Object();
if(!mShared.data.mStats)
{
SetField("sound",_SoundActive);
SetField("showmessages",_ShowMessages);
SetField("fastrender",_FastRender);
CMochiBot.SHZ_BO_UNIQUES();
}
mSoundActive = GetField("sound");
mFastRender = GetField("fastrender");
mStats = mShared.data.mStats = !!mShared.data.mStats ? mShared.data.mStats : new Object();
mUnitNames = new Object();
mUnitNames.peepak47 = {
"mName":"Freedom fighter",
"mType":"enemy"
};
mUnitNames.gunak47 = mUnitNames.peepak47;
mUnitNames.peepm16 = {
"mName":"Special forces soldier",
"mType":"friend"
};
mUnitNames.gunm16 = mUnitNames.peepm16;
mUnitNames.scudlauncher = {
"mName":"SCUD launcher",
"mType":"enemy"
};
mUnitNames.tankm1a1 = {
"mName":"M1A1 Abrams Battle tank",
"mType":"friend"
};
mUnitNames.truckflatbed = {
"mName":"Bomb truck",
"mType":"enemy"
};
mUnitNames.truckflatbedaa = {
"mName":"Homemade AA truck",
"mType":"enemy"
};
mUnitNames.apache = {
"mName":"Apache attack helicopter",
"mType":"friend"
};
mUnitNames.cessna = {
"mName":"Suicide plane",
"mType":"enemy"
};
mUnitNames.chinook = {
"mName":"Chinook transport helicopter",
"mType":"friend"
};
mUnitNames.artilleryshell = {
"mName":"Artillery Strike",
"mType":"friend"
};
mUnitNames.airbomb = {
"mName":"Air bomb strike",
"mType":"friend"
};
mUnitNames.clusterbomb = {
"mName":"Cluster bomb strike",
"mType":"friend"
};
mUnitNames.strikeairbomb = mUnitNames.airbomb;
mUnitNames.strikeclusterbomb = mUnitNames.clusterbomb;
mUnitNames.strikeartillery = mUnitNames.artilleryshell;
mUnitNames.gunm1a1 = mUnitNames.tankm1a1;
mUnitNames.hellfire = mUnitNames.apache;
mUnitNames.gunfbaa = mUnitNames.truckflatbedaa;
mUnitNames.tomahawk = {
"mName":"Tomahawk missile",
"mType":"friend"
};
mUnitNames.patriot = {
"mName":"Patriot missile",
"mType":"friend"
};
mUnitNames.bullet = {
"mName":"Bullet",
"mType":"none"
};
mUnitNames.scud = mUnitNames.scudlauncher;
mUnitNames.explosion = {
"mName":"Explosion",
"mType":"none"
};
mUnitNames.explosionsmall = mUnitNames.explosion;
mUnitNames.explosionmedium = mUnitNames.explosion;
mUnitNames.explosionlarge = mUnitNames.explosion;
CKongregate.AddStat("Enemy Kills","Enemy Kills");
}
public static function GetStat(param1:String) : uint
{
return mStats[param1];
}
public static function set mShowMessages(param1:Boolean) : void
{
SetField("showmessages",_ShowMessages = param1);
}
public static function get mShowMessages() : Boolean
{
return _ShowMessages;
}
}
}